package nl.saxion.dbi.model;

import lombok.Data;
import nl.saxion.dbi.api.BazenbaseUtility;

@Data
public class Veld implements StringBasedPropertyAble {

	private int id;

	private String naam;

	private String type;

	private boolean notNull;

	@Override
	public Object getProperty(String property) {
		switch (property) {
			case "id" :
				return id;
			case "naam" :
				return naam;
			case "type" :
				return type;
			case "not_null" :
				return notNull;
			case "tabel_id" :
				return BazenbaseUtility.getInstance().getTabelByVeld(this)
						.getId();
		}
		throw new IllegalStateException("Property " + property
				+ " is niet geldig voor Veld");
	}

}
